package com.bw.lib_mvvm

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding

/**
 *@ClassName BaseActivity
 *@Author hu..
 *@Data 2024/7/21
 *@Description
 */
abstract class BaseActivity <VDB: ViewDataBinding>: AppCompatActivity(){
    protected lateinit var viewDataBinding: VDB

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        viewDataBinding = DataBindingUtil.setContentView(this,bindLayout())
        initView()
        initData()
    }
    abstract fun initView()
    abstract fun initData()
    abstract fun bindLayout(): Int
}